<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let a = "aaeeecddd"
        let z = 0
        let x = 0
        let c = 0
        let v = 0
        for (const i in a) {
            console.log(a[i]);
            if (a[i] == "a") {
                z++
            }
            if (a[i] == "e") {
                x++
            }
            if (a[i] == "c") {
                c++
            }
            if (a[i] == "d") {
                v++
            }
        }
        console.log("a:" + z, "e:" + x, "c:" + c, "d:" + v);
    </script>
</body>

</html>